1. Field of the Invention
The present invention relates to color processing of image-sensing data captured by an image sensing unit that has a color filter array in which filters of a plurality of colors are arranged.
2. Description of the Related Art
Many electronic cameras use a single image sensing device upon generating an image signal for a color image. FIG. 1 is a view showing the arrangement (Bayer arrangement) of a three-color (red R, green G, and blue B) filter array of such an image sensing device. Focusing on G components, the image sensing device can be considered to have a structure in which image sensing elements (G pixels, hereinafter) that output G components and image sensing elements (R pixels and B pixels, hereinafter) that do not output G components are arranged in a checkered pattern.
A technique (demosaicing) of generating a color image by interpolating an image signal generated by a single image sensing device interpolates G components corresponding to the positions of R and B pixels of the image sensing device having a color filter array with a Bayer arrangement by using the average values of the adjacent G pixels. Then, R components corresponding to the positions of G and B pixels, and B components corresponding to the positions of G and R pixels are interpolated using the pixel values obtained by interpolating the G components.
Japanese Patent Laid-Open No. 8-298669 discloses a technique of changing an interpolation method according to the tendency of an object. Particularly, it discloses a technique of calculating an interpolation amount by estimating the tendency of color using a color gradient.
FIG. 2 illustrates interpolation processing disclosed by the above-described document. Respective pixels shown in FIG. 2 are:                R pixel: R11, R13, . . . , R55        G pixel: G12, G14, . . . , G54        B pixel: B22, B24, . . . , B44        
When calculating an interpolation amount G33 of the G component of a pixel R33, information HDiff about the color gradient in the horizontal direction and information VDiff about the color gradient in the vertical direction are calculated by:HDiff=|2×R33−R31−R35|+|G32−G34|VDiff=|2×R33−R13−R53|+|G23−G43|  (1)
According to the magnitudes of HDiff and VDiff, the calculation method of G33 is changed.                if HDiff<VDiff (the correlation in the horizontal direction is strong),G33=(G32+G34)/2+(2×R33−R31−R35)/4        if VDiff<HDiff (the correlation in the vertical direction is strong),G33=(G23+G43)/2+(2×R33−R13−R53)/4        if VDiff=HDiff,G33=(G23+G34+G43+G32)/4+(−R13+R31+4×R33−R35−R53)/8   (2)        
That is, upon obtaining the interpolation amount of a G component, the above-described technique estimates information about the color gradient of the G component based on the outputs of R pixels (or B pixels). As a result, the interpolation method can be changed by determining tendency in a spatial direction such as the edge of an object.
However, the above-described technique does not change the interpolation method according to the color characteristic of an object. When uniform interpolation processing is executed irrespective of the color characteristic of an object, the interpolation accuracy may deteriorate depending on the color characteristic of the object.
For example, when the above-described technique is applied to an image signal of a generally red object, which has not undergone interpolation, to interpolate G components and then R and B components are interpolated, since the G components are interpolated first even though the R components possess substantial color information of the object, a sufficient sharpness cannot be obtained.
In addition, in the case of an image signal in which there is no correlation between the gradient of a G component and that of an R component, an image signal which has few R components, or the like, the tendency of a G component cannot be estimated with a high accuracy based on the outputs of R pixels even when the above-described technique is applied, and noise may occur in the image after the interpolation.